<?php
class TaobaoOAuth{
	private $AKEY;
	private $SKEY;
	private $TOKEN;
	private $TOKEN_SECRET;
	
	function __construct($AKEY,$SKEY,$TOKEN = NULL,$TOKEN_SECRET = NULL){
		$this -> AKEY = $AKEY;
		$this -> SKEY = $SKEY;
		$this -> TOKEN = $TOKEN;
		$this -> TOKEN_SECRET = $TOKEN_SECRET;
	}
	
	function getAuthorizeURL($RedirectUrl){
		return 'http://container.api.taobao.com/container?encode=utf-8&appkey='.$this->AKEY;
	}
	
	function verifysign($top_appkey,$top_parameters,$top_session){
		$str = $top_appkey.$top_parameters.$top_session.$this->SKEY;
		$sign = md5($str,true);
		return base64_encode($sign);
	}
}